﻿#ifndef PST_SCALARBARSETTINGDATA_H
#define PST_SCALARBARSETTINGDATA_H

#include <QObject>
#include <QColor>
#include <QDomNodeList>
#include <QDomElement>
#include <QDomText>
#include <QDomAttr>

namespace pst
{
    class ScalarBarSettingData : public QObject
    {
    public:
        ScalarBarSettingData(QObject* parent = nullptr);

    public:
        //====ScalarBarSettingData====//
        void setScalarBarFontSize(int fontSize);
        int getScalarBarFontSize() const;

        void setScalarBarMaxValue(double maxValue);
        double getScalarBarMaxValue() const;

        void setScalarBarMinValue(double minValue);
        double getScalarBarMinValue() const;

        void setScalarBarAutoRange(bool isAutoRange);
        bool getScalarBarAutoRange() const;

        void setScalarBarIsShowTitle(bool isShowTitle);
        bool getScalarBarIsShowTitle() const;

        void setScalarBarTitleColor(QColor titleColor);
        QColor getScalarBarTitleColor() const;

        void setScalarBarFontFamily(QString fontFamily);
        QString getScalarBarFontFamily() const;

        void setScalarBarTitle(QString title);
        QString getScalarBarTitle() const;

        void setScalarBarOriginalMinRange(double minValue);
        double getScalarBarOriginalMinRange() const;

        void setScalarBarOriginalMaxRange(double maxValue);
        double getScalarBarOriginalMaxRange() const;

        void setScalarBarIsLog(bool isLog);
        bool getScalarBarIsLog() const;

        void setScalarBarUnit(QString unit);
        QString getScalarBarUnit() const;

        /// @brief 文件写出至工程文件
        QDomElement& writeToProjectFile(QDomDocument* doc, QDomElement* element, bool isdiso = false);
        /// @brief 从工程文件读入数据
        void readFromProjectFile(QDomElement* element, bool isdiso = false);

    private:
        int m_fontSize = 20;
        double m_maxValue = 1.0;
        double m_minValue = 0.0;
        bool m_isUseScalarBarAutoRange = true;
        bool m_isShowTitle = true;
        QColor m_titleColor = Qt::black;
        QString m_fontFamily = "宋体";
        QString m_title = "";
        int m_isLog = false;
        QString m_unit = "";
        double m_scalarBarMinValueOriginal = 0.0;
        double m_scalarBarMaxValueOriginal = 1.0;
    };
}
#endif
